public class Solution1220 {
    private static final int mod = 1000000007;

    public int countVowelPermutation(int n) {
        int a=1,e=1,i=1,o=1,u=1;
        for (int k=2;k<=n;k++){
            int a1=((e+i)%mod+u)%mod;
            int e1=(a+i)%mod;
            int i1=(e+o)%mod;
            int o1=i;
            int u1=(i+o)%mod;
            a=a1;
            e=e1;
            i=i1;
            o=o1;
            u=u1;
        }
        return ((((a+e)%mod+i)%mod+o)%mod+u)%mod;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1220().countVowelPermutation(5));
    }
}
